package J.算法.排序;

import javax.swing.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class exe {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str = br.readLine())!= null){
            String[] strs = str.split(",");
            int[] nums = new int[strs.length];
            for (int i = 0; i < strs.length; i++) {
                nums[i] = Integer.valueOf(strs[i]);

            }
            //bubbleSort(nums);
            //selectedSort(nums);
            //insertSort(nums);
           // shellSort(nums);
            quickSort(nums,0,nums.length-1);
            for (int num:nums){
                System.out.print(num);
            }



        }

    }

    public static void bubbleSort(int[] nums){

        boolean change = false;
        int temp = 0;
        for (int i = 0; i < nums.length-1; i++) {
            for (int j = 0; j < nums.length-1-i; j++) {

                if (nums[j]>nums[j+1]){
                    change = true;
                    temp = nums[j];
                    nums[j] = nums[j+1];
                    nums[j+1] = temp;
                }

            }
            if (!change){
                break;
            }

        }


    }

    /**
     * 定第一个最小 往后寻找最小数值 然后交换
     * @param nums
     */
    public static void selectedSort(int[] nums){

        for (int i = 1; i < nums.length; i++) {
            int minIndex = i-1;
            int temp = nums[minIndex];
            for (int j = i; j < nums.length; j++) {
                if (nums[j] < temp){
                    minIndex = j;
                }
            }
            if (minIndex != i-1){
                nums[i-1] = nums[minIndex];
                nums[minIndex] = temp;
            }
        }
    }
    /**
     * 插入排序
     */
    public static void insertSort(int[] nums){

        for (int i = 1; i < nums.length; i++) {
            int insertValue = nums[i];
            int searchIndex = i-1;

            while (searchIndex>= 0 && nums[searchIndex] > insertValue){
                nums[searchIndex+1] = nums[searchIndex];
                searchIndex--;
            }

            nums[searchIndex+1] = insertValue;


        }
    }

    /**
     * shell
     */
    public static void shellSort(int[] nums){

        for (int gap = nums.length/2;gap>0;gap/=2){
            for (int i=gap;i<nums.length;i++){
                int searchIndex = i;
                int temp= nums[searchIndex];

                while (searchIndex-gap>=0 && temp > nums[searchIndex-gap]){
                    nums[searchIndex] = nums[searchIndex-gap];
                    searchIndex -= gap;
                }

                nums[searchIndex] = temp;
            }
        }

    }

    /**
     * 快排
     * @param nums
     * @param start
     * @param end
     */
    public static void quickSort(int[] nums,int start ,int end){
        if (start < end){
            int base = nums[start];
            int low = start;
            int high = end;

            while (low < high){

                while (low < high && nums[high]>base){
                    high--;
                }
                nums[low] = nums[high];

                while (low<high && nums[low]<base){
                    low++;
                }
                nums[high] = nums[low];
            }

            nums[low] = base;


            quickSort(nums,start,low);
            quickSort(nums,low+1,end);
        }





    }
}

